﻿using System.Collections.Generic;
using FixMath;
using UniFramework.Actor;

namespace UniFramework.Buff
{
	/// <summary>
	/// 创建BuffObj的中间件，每次要给角色的Buff做增删查改都需要创建一条AddBuffInfo
	/// 而不是直接修改角色身上的Buff
	/// </summary>
	public struct AddBuffInfo
	{
		public BuffConfig buffConfig;
		public LogicActor release;//buff负责人，可以是空
		public LogicActor target;//buff要添加给谁，不能为空
		public int addStack; //要添加的层数
		public bool durationSetTo; //时间改变还是设置为
		public bool permanent;//是否是永久buff
		public FixInt duration;
		public Dictionary<string, object> buffParam;

		public AddBuffInfo(
			BuffConfig config, LogicActor release, LogicActor target,
			int stack, FixInt duration, bool durationSetTo = true,
			bool permanent = false,
			Dictionary<string, object> buffParam = null
		)
		{
			this.buffConfig = config;
			this.release = release;
			this.target = target;
			this.addStack = stack;
			this.duration = duration;
			this.durationSetTo = durationSetTo;
			this.buffParam = buffParam;
			this.permanent = permanent;
		}
	}
}